function ValueSelecter(id, id_label, id_image)
{
	this.id = id;
	this.idLabel = id_label;
	this.idImage = id_image;
	this.opciones = new Array();
	this.labels = new Array();
	this.images = new Array();
	this.createOption = createOption;
	this.addOption = addOption;
	this.changeTo = changeTo;
}

function createOption(key, label, image)
{
	this.opciones[key] = new Array();
	this.labels[key] = label;
	this.images[key] = image;
}

function addOption(key, value, label)
{
	this.opciones[key][value] = new Array();
	this.opciones[key][value][0] = value;
	this.opciones[key][value][1] = label;
}

function changeTo(key)
{
	var tag = document.getElementById(this.id);
	var length = 0;
	for(i in this.opciones[key])
	{
		length++;
	}
	tag.options.length = length;
	var j = 0;
	for(i in this.opciones[key])
	{
		tag.options[j].value = i[0];
		tag.options[j].text = i[1];
		j++;
	}
	var label = document.getElementById(this.idLabel);
	label.innerHTML = this.labels[key];
	var image = document.getElementById(this.idImage);
	image.src = this.images[key];
}
